/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PmContract2 extends BasicModel<PmContract2> {
  clsCode?: string; // 合同分类
  code?: string; // 合同编号
  name?: string; // 合同名称
  ctype?: string; // 合同类型
  isum?: number; // 合同金额
  isum2?: number; // 安全文明措施费
  isum3?: number; // 监理费
  contractNo?: string; // 存档编号
}

export const pmContract2List = (params?: PmContract2 | any) =>
  defHttp.get<PmContract2>({ url: adminPath + '/proj/contract/pmContract2/list', params });

export const pmContract2ListData = (params?: PmContract2 | any) =>
  defHttp.post<Page<PmContract2>>({
    url: adminPath + '/proj/contract/pmContract2/listData',
    params,
  });

export const pmContract2Form = (params?: PmContract2 | any) =>
  defHttp.get<PmContract2>({ url: adminPath + '/proj/contract/pmContract2/form', params });

export const pmContract2Save = (params?: any, data?: PmContract2 | any) =>
  defHttp.postJson<PmContract2>({
    url: adminPath + '/proj/contract/pmContract2/save',
    params,
    data,
  });

// /proj/contract/pmContract2/uploadBatch
export const pmContract2UploadBatch = (params?: any, data?: PmContract2 | any) =>
  defHttp.postJson<PmContract2>({
    url: adminPath + '/proj/contract/pmContract2/uploadBatch',
    params,
    data,
  });

export const pmContract2Delete = (params?: PmContract2 | any) =>
  defHttp.get<PmContract2>({ url: adminPath + '/proj/contract/pmContract2/delete', params });

export const pmContract2TreeData = (params?: any) =>
  defHttp.get<PmContract2[]>({
    url: adminPath + '/proj/contract/pmContract2/treeData',
    params,
  });
